﻿using System;
using System.ServiceModel;
using System.ServiceModel.Channels;
using XchangeStreamer.Core.Sender;

namespace XchangeStreamer.Publisher.SDK
{
    internal sealed class Sender : ClientBase<ISender>, ISender
    {
        #region Public Const.

        public Sender(Binding binding, EndpointAddress remoteAddress)
            : base(binding, remoteAddress)
        {
        }

        #endregion

        #region ISender Members

        public IAsyncResult BeginSend(Message message, AsyncCallback callback, object state)
        {
            return this.Channel.BeginSend(message, callback, state);
        }

        public void EndSend(IAsyncResult result)
        {
            this.Channel.EndSend(result);
        }

        #endregion
    }
}